package com.trkj.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.trkj.dao.MemberDAO;
import com.trkj.dao.MemberDAOFactory;
import com.trkj.entity.Member;

/**
 * Servlet implementation class InitMemberServlet
 */
@WebServlet("/init_member")
public class InitMemberServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private MemberDAO memberDAO = MemberDAOFactory.createDAO();

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int mid = Integer.parseInt(request.getParameter("mid"));
		Member member = memberDAO.get(mid);
		request.setAttribute("m", member);
		request.getRequestDispatcher("full.jsp").forward(request, response);
	}

}